package com.zy.web.api;

import com.zy.configs.FeignMultipartSupportConfig;
import com.zy.web.bean.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

//这是一个文件上传的feign接口，上传的文件的协议需要另外配置.
@FeignClient(   name="fileUpload", configuration = FeignMultipartSupportConfig.class)
public interface FileUploadApi {

    @RequestMapping(  value="/upload",method = RequestMethod.POST,  consumes = MediaType.MULTIPART_FORM_DATA_VALUE )
    public ResponseResult upload(
            @RequestPart("uploadFiles") MultipartFile[] uploadFiles
    );
}
